var utilFF = require("../../utils/util_getFootBall")
const util = require('../../utils/util')
// var utilFFpm = require("../../utils/util_getBasketBallPm")

Page({

  /**
   * 页面的初始数据
   */
  data: {

    result:[],
    startDate: null,
    endDate: new Date().getFullYear() + '-12-31',
    currentDate: util.formatTime(new Date(), '-', false),

  },
  getFootBall:function(){
    var that = this;
    utilFF.getFootBallData(function(res){
      console.log(res)
      
      that.setData({
        result:res.result.data,
        // rq:res.result.matchs,
      
      });
   
    });
},
  // getFootBallPm:function(){
  //   var that = this;
  //   utilFFpm.getFootBallPmData(function(res){
      
  //     that.setData({
  //       // dongbu:res.result.ranking[0],
  //       // xibu:res.result.ranking[1]
        
  //     });    
  //   });
  // },
  
  bindDateChange: function (e) {
    console.log(e.detail.value)
    this.setData({
      currentDate:e.detail.value
    }) 
  
    if (e.detail.value == this.data.rq[0].date){
      this.setData({
        shuju:this.data.rq[0].list
      })
    }
    else if (e.detail.value == this.data.rq[1].date){
      this.setData({
        shuju:this.data.rq[1].list
      })
    }
    else if (e.detail.value == this.data.rq[2].date){
      this.setData({
        shuju:this.data.rq[2].list
      })
    }
    else if (e.detail.value == this.data.rq[3].date){
      this.setData({
        shuju:this.data.rq[3].list
      })
    }
    else if (e.detail.value == this.data.rq[4].date){
      this.setData({
        shuju:this.data.rq[4].list
      })
    }
    else if (e.detail.value == this.data.rq[5].date){
      this.setData({
        shuju:this.data.rq[5].list
      })
    }
    else{
      this.setData({
        shuju:this.data.rq[6].list
      })
    }
  },
  
  onclick1:function(){
    var x = this.data.x
    if(x==false){
      this.setData({
        x:true
      })
    }
    else if(x==true){
      this.setData({
        x:false
      })
    }

  },

  onLoad: function (options) {
    this.getFootBall();

  },

  onReady: function () {

  },

  onShow: function () {


  },

})